package com.yusys.test;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;

public class ReflectQuestion {

    public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
        Properties properties = new Properties();
        properties.load(new FileInputStream("02-反射/src/re.properties"));
        String classFullPath = properties.getProperty("classFullPath").toString();
        String methodName = properties.getProperty("method").toString();
        System.out.println(classFullPath);
        System.out.println(methodName);
        Class cls = Class.forName(classFullPath);
        Object o = cls.newInstance();
        System.out.println(cls);
        Method method = cls.getMethod(methodName);
        method.invoke(o);
    }
}
